// ---- Created with 3Dmigoto v0.6.164 on Sat Jan 31 09:54:04 2026
Texture2D<float4> t0 : register(t0);

SamplerState s0_s : register(s0);

cbuffer cb0 : register(b0)
{
  float4 cb0[6];
}

cbuffer cb13 : register(b13)
{
  float4 cb13[26];
}



// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);
Texture2D<float4> stereo2mono : register(t100);


void main(
  float4 v0 : SV_POSITION0,
  float4 v1 : COLOR0,
  float2 v2 : TEXCOORD1,
  out float4 o0 : SV_Target0)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;
  
float4 s = StereoParams.Load(0);
float4 testeo = IniParams.Load(int2(90,0));

//Copia de la posición:
float2 pos = v2.xy;

//Estirarla al doble de ancho:
pos.x = pos.x / 2;

//Para el ojo derecho (creo recordar), mover la posición para que empiece a partir de la mitad derecha de la textura:
if (s.z == -1) {
    pos.x += 0.5;
  }

//Usar la textura copiada de stereo2mono en lugar de la original:
r0.xyzw = stereo2mono.Sample(s0_s, pos.xy).xyzw;


 
  //r0.xyzw = t0.Sample(s0_s, v2.xy).xyzw;
  r0.xyz = cb0[5].xyz * r0.xyz;
  o0.xyz = v1.xyz * r0.xyz;
  o0.w = 1;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v0.6.164 on Sat Jan 31 09:54:04 2026
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float
// COLOR                    0   xyzw        1     NONE   float   xyz
// TEXCOORD                 1   xy          2     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_4_0
dcl_constantbuffer CB0[6], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xyz
dcl_input_ps linear v2.xy
dcl_output o0.xyzw
dcl_temps 1
sample r0.xyzw, v2.xyxx, t0.xyzw, s0
mul r0.xyz, r0.xyzx, cb0[5].xyzx
mul o0.xyz, r0.xyzx, v1.xyzx
mov o0.w, l(1.000000)
ret
// Approximately 0 instruction slots used

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
